package com.example.cloudconsumerpayment.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @author zhaoren
 * @version 1.0
 * @description TODO
 * @date 2020/9/2 16:22
 **/
@RestController
public class SluthController {

    private static final String MICRO_SERVICE_ID = "http://cloud-provider-payment";

    @Autowired
    private RestTemplate restTemplate;

    @GetMapping("test")
    public String test(){
        String forObject = restTemplate.getForObject(MICRO_SERVICE_ID + "/info", String.class);
        return forObject;
    }


}
